//
//  JSMAboutMeViewController.m
//  TakeYouTourTogether
//
//  Created by dllo on 15/12/3.
//  Copyright © 2015年 king. All rights reserved.
//

#import "JSMAboutMeViewController.h"

@interface JSMAboutMeViewController ()

@end

@implementation JSMAboutMeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = LanguageTool(@"关于我们");
    self.navigationController.navigationBar.translucent = NO;
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"<<" style:UIBarButtonItemStylePlain target:self action:@selector(backAction)];
    [self createView];
}

- (void)backAction{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)createView{
    BaseImageView *imageView = [[BaseImageView alloc]init];
    [self.view addSubview:imageView];
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.equalTo(self.view).with.offset(64);
        make.height.mas_equalTo(200);
        make.width.mas_equalTo(200);
    }];
    imageView.image = [UIImage imageNamed:@"mehhh"];
    imageView.layer.cornerRadius = 100;
    
    BaseLabel *label = [[BaseLabel alloc]init];
    [self.view addSubview:label];
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(imageView.mas_bottom).with.offset(30);
        make.left.equalTo(self.view);
        make.right.equalTo(self.view);
        make.height.mas_equalTo(100);
    }];
    label.textAlignment = NSTextAlignmentCenter;
    label.text = LanguageTool(@"如果你不出去走走，你就会以为这就是世界\n \n梦想，并不奢侈");
    label.textColor = [UIColor darkGrayColor];
    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc]initWithString:label.text];
    NSRange range = [label.text rangeOfString:LanguageTool(@"梦想，并不奢侈")];
    [attributedString setAttributes:@{NSForegroundColorAttributeName : [UIColor blackColor]} range:range];
    //显示在label上
    label.attributedText = attributedString;
    label.numberOfLines = -1;
    [label sizeToFit];
    
    BaseLabel *versionLabel = [[BaseLabel alloc]init];
    [self.view addSubview:versionLabel];
    [versionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).with.offset(-20);
        make.centerX.equalTo(self.view);
        make.height.mas_equalTo(50);
        make.width.mas_equalTo(200);
    }];
    versionLabel.textAlignment = NSTextAlignmentCenter;
    versionLabel.textColor = [UIColor lightGrayColor];
    versionLabel.font = [UIFont systemFontOfSize:13];
    versionLabel.text = [NSString stringWithFormat:@"%@ %@.0", LanguageTool(@"当前版本"),[VersionJudgment versionJudgment]];

    

    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
